package com.dpp.mapper;

import com.dpp.entity.CouponImg;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface CouponImgMapper {
    @Insert("insert into coupon_img(coupon_id,url,is_use) values(#{couponId},#{url},#{isUse})")
    void insert(CouponImg couponImg);
    @Select("select * from coupon_img where url=#{url}")
    CouponImg selectByUrlId(String url );
    @Update("UPDATE coupon_img SET openid=#{openid},is_use=#{isUse} where url=#{url}" )
    void updateByPrimaryKey(CouponImg couponImg);
    @Select("select * from coupon_img where openid=#{openid}")
    List<CouponImg> selectByOpenid(String openid);
}
